-- GENERATED SPELL FOR [Gordunni Mage-Lord] --


function spell0_5239(pUnit, Event) --@Bloodlust,n/a--
pUnit:FullCastSpellOnTarget(6742,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5239', 30309, 1)
end

function spell1_5239(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(20823,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5239', 3000, 1)
end

function spell2_5239(pUnit, Event) --@Flamestrike,n/a--
pUnit:FullCastSpellOnTarget(20827,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5239', 11000, 1)
end

function Sorts_5239(pUnit, Event)
local choix_sorts_5239 = math.random(0, 2)
if choix_sorts_5239 == 0 then
pUnit:RegisterEvent('spell0_5239', 1, 1)
end
if choix_sorts_5239 == 1 then
pUnit:RegisterEvent('spell1_5239', 1, 1)
end
if choix_sorts_5239 == 2 then
pUnit:RegisterEvent('spell2_5239', 1, 1)
end
end

function mob5239_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_5239', math.random(1500, 3000), 1)
end

function mob5239_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5239_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5239_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(5239, 1, 'mob5239_Action')
RegisterUnitEvent(5239, 2, 'mob5239_Leave')
RegisterUnitEvent(5239, 3, 'mob5239_Kill')
RegisterUnitEvent(5239, 4, 'mob5239_Die')
